package cn.itsource.test;

/**
 * @author : 张金铭
 * @description :
 * @create :2023-04-14 15:35:00
 */
public class testTask {
    static Object pen = new Object();
    static Object book = new Object();

    public static void main(String[] args) {
//        new Thread(() -> {
//            synchronized (pen){
//                System.out.println("pen of T1");
//                try {
//                    Thread.sleep(2000);
//                    synchronized (book){
//                        System.out.println("book of T1");
//                    }
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
//            }
//        }).start();
//
//        new Thread((() -> {
//            synchronized (book){
//                synchronized (book){
//                    System.out.println("book of T2");
//                    synchronized (pen){
//                        System.out.println("pen of T2");
//                    }
//                }
//            }
//        })).start();

        System.out.println(System.currentTimeMillis());
    }
}
